package deviceService

import "hc_server/routers/models"

// Model 设备类型
type Model struct {
	Id     int //类型id
	No     string
	Type   string //设备类型
	TypeId int    //设备类型表主键id
	Icon   string

	AgentId  int
	PageNum  int
	PageSize int
	Keyword  string
}

// DeviceModelInfoAdd 添加设备类型
func (m *Model) DeviceModelInfoAdd() error {
	return models.DeviceModelInfoAdd(models.DeviceModel{
		Icon:         m.Icon,
		DeviceNo:     m.No,
		DeviceType:   m.Type,
		DeviceTypeId: m.TypeId,
	})
}

// DeviceModelInfoList 设备类型列表
func (m *Model) DeviceModelInfoList() (map[string]interface{}, error) {
	return models.DeviceModelInfoList(m.AgentId, m.PageNum, m.PageSize)
}
